/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import org.w3c.dom.ls.LSOutput;

import javax.swing.*;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/**
 * <p>Project: javaseapp - Out1
 * <p>Powered by webrx On 2021-07-29 11:15:27
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Out1 {
    public static void main(String[] args) throws FileNotFoundException {
        //控制台输出
        System.out.println();
        System.out.print("\n");
        System.out.print("a");
        System.out.print("b");
        System.out.println("java");
        System.out.printf("%s%d%f%tF%n","java",20,1.5,System.currentTimeMillis());
        String info = String.format("%1$tY年%1$tm月%1$td日",System.currentTimeMillis());
        System.out.println(info);
        System.err.println("hello error message");

        //对话框输出
        JOptionPane.showMessageDialog(null, "hello world");
        JOptionPane.showMessageDialog(null, "132", "showuser", JOptionPane.ERROR_MESSAGE);

        //文件输出，将内容输出到文件中
        //PrintWriter out = new PrintWriter("c:/user.log");  每次覆盖文件

        //true 代表追加文件写文件
        PrintWriter out = new PrintWriter(new FileOutputStream("c:/user.log", true));
        out.printf("今日日期：%1$tF %1$tT %1$tA %n", System.currentTimeMillis());
        //out.append(String.format("今日日期：%1$tF %1$tT %1$tA %n", System.currentTimeMillis()));
        out.close();
    }
}
